Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(platform-server): wait for async app initializers to complete before removing server side styles #16712

Merged
merged 1 commit into from
May 16, 2017

Conversation

vikerman
Copy link
Contributor

This fixes a flicker when transitioning from server rendered page to client rendered page in lazy loaded routes by waiting for the lazy loaded route to finish loading, assuming initialNavigation on the route is set to 'enabled'.

Fixes #15716

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x")

[X] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

What is the current behavior? (You can also link to an open issue here)
There is a flicker when transitioning from server side rendered page to lazy loaded routes, even when initialNavigation is set to 'enabled'

What is the new behavior?
There is no flicker. Server side styles are removed only after the lazy loaded route has finished loading.

Does this PR introduce a breaking change? (check one with "x")

[ ] Yes
[X] No

@mary-poppins
Copy link

The angular.io preview for b7149ef is available here.

@vikerman vikerman requested a review from IgorMinar May 15, 2017 22:04
for (let i = 0; i < appInits.length; i++) {
const initResult = appInits[i]();

const that = this;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const complete = () => {...}

Array.prototype.slice.apply(dom.querySelectorAll(document, `style[ng-transition]`));
styles.filter(el => dom.getAttribute(el, 'ng-transition') === transitionId)
.forEach(el => dom.remove(el));
export function bootstrapListenerFactory(transitionId: string, document: any, injector: Injector) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe update this old name?

@mary-poppins
Copy link

The angular.io preview for 463de25 is available here.

@mary-poppins
Copy link

The angular.io preview for 41af912 is available here.

@mary-poppins
Copy link

The angular.io preview for fd72c2c is available here.

Copy link
Contributor

@IgorMinar IgorMinar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the public api change. otherwise lgtm

…ore removing server side styles

This fixes a flicker when transitioning from server rendered page to client rendered page in lazy loaded routes by waiting for the lazy loaded route to finish loading, assuming initialNavigation on the route is set to 'enabled'.

Fixes #15716
@mary-poppins
Copy link

The angular.io preview for 0aff4fc is available here.

@mary-poppins
Copy link

The angular.io preview for 43a6fbf is available here.

@vikerman vikerman added the action: merge The PR is ready for merge by the caretaker label May 16, 2017
@jasonaden jasonaden merged commit c805082 into angular:master May 16, 2017
jasonaden pushed a commit that referenced this pull request May 17, 2017
…ore removing server side styles (#16712)

This fixes a flicker when transitioning from server rendered page to client rendered page in lazy loaded routes by waiting for the lazy loaded route to finish loading, assuming initialNavigation on the route is set to 'enabled'.

Fixes #15716
asnowwolf pushed a commit to asnowwolf/angular that referenced this pull request Aug 11, 2017
…ore removing server side styles (angular#16712)

This fixes a flicker when transitioning from server rendered page to client rendered page in lazy loaded routes by waiting for the lazy loaded route to finish loading, assuming initialNavigation on the route is set to 'enabled'.

Fixes angular#15716
juleskremer pushed a commit to juleskremer/angular that referenced this pull request Aug 28, 2017
…ore removing server side styles (angular#16712)

This fixes a flicker when transitioning from server rendered page to client rendered page in lazy loaded routes by waiting for the lazy loaded route to finish loading, assuming initialNavigation on the route is set to 'enabled'.

Fixes angular#15716
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using platform server, lazy loaded component flickers as the browser renders the application
6 participants